<?php

class imageForms extends form {

	public static function add($errors)
	{
		return '<form method="post" enctype="multipart/form-data">
				<fieldset>
					<legend>Uploading new picture</legend>
					<input type="hidden" name="MAX_FILE_SIZE" value="4000000" />
					<p>Please select JPG/JPEG image file: <input type="file" name="imgFile" /></p>
					<p>Title: <input type="text" name="title" /></p>
					<p>Caption:</p>
					' . form::textarea('caption', self::postValue('caption')) . '
					<p>Date: ' . form::date(self::postValue('date')) . '</p>
					<p><input type="submit" name="submit" value="Upload Image" /></p>
				</fieldset>
				</form>';
	}
	
	public static function edit($errors, $image)
	{
		return '<form method="post" enctype="multipart/form-data">
				<fieldset>
					<legend>Edit Image</legend>
					<p><img src="' . ROOT_URL . 'content/images/small/' . $image->url . '" alt=""/></p>
					<p>Title: <input type="text" name="title" value="' . $image->title . '"/></p>
					<p>Caption:</p>
					' . form::textarea('caption', $image->caption) . '
					<p>Date: ' . form::date(date('m/d/Y',$image->date)) . '</p>
					<p><input type="submit" name="submit" value="Update Image" /></p>
				</fieldset>
				</form>';
	}
	
	public static function upload5($errors)
	{
		return '<form method="post" enctype="multipart/form-data">
				<fieldset>
					<legend>Uploading new picture</legend>
					<input type="hidden" name="MAX_FILE_SIZE" value="4000000" />
					<p>Please select JPG/JPEG image file: <input type="file" name="imgFile[]" /></p>
					<p>Please select JPG/JPEG image file: <input type="file" name="imgFile[]" /></p>
					<p>Please select JPG/JPEG image file: <input type="file" name="imgFile[]" /></p>
					<p>Please select JPG/JPEG image file: <input type="file" name="imgFile[]" /></p>
					<p>Please select JPG/JPEG image file: <input type="file" name="imgFile[]" /></p>
					<p><input type="submit" name="submit" value="Upload Images" /></p>
				</fieldset>
				</form>';
	}
}
?>